//
//  TicketTabBarController.m
//  majia
//
//  Created by wengchangqing on 2018/9/4.
//  Copyright © 2018年 Anhui hongzuo information technology co. LTD. All rights reserved.
//

#import "TicketTabBarController.h"
#import "TicketNavgationController.h"
#import "TicketHomeController.h"
#import "TicketNewsController.h"
#import "TicketMineController.h"


@interface TicketTabBarController ()
{
    NSArray *titles;
}

@end

@implementation TicketTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    titles = @[@"首页", @"资讯", @"我的"];
    
    TicketHomeController *home = [[TicketHomeController alloc] init];
    TicketNavgationController *homeNav = [[TicketNavgationController alloc]initWithRootViewController:home];
    
    TicketNewsController *news = [[TicketNewsController alloc] init];
    TicketNavgationController *newsNav = [[TicketNavgationController alloc]initWithRootViewController:news];
    
    TicketMineController *mine = [[TicketMineController alloc] init];
    TicketNavgationController *mineNav = [[TicketNavgationController alloc]initWithRootViewController:mine];
    
    self.viewControllers = @[homeNav, newsNav, mineNav];
 
    [self.tabBar.items enumerateObjectsUsingBlock:^(UITabBarItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UITabBarItem *item = self.tabBar.items[idx];
        item.title = self->titles[idx];
//        item.image =
    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
